package com.bjqg.bjqg01.bjqg.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.bjqg.bjqg01.bjqg.R;
import com.bjqg.bjqg01.bjqg.utils.ToastUtil;

/**
 * Created by Administrator on 2018/4/11 0011.
 */

public class ProjectInformationActivity extends BaseActivity implements View.OnClickListener {

    private ImageView goback;
    private TextView toptitle;
    private ImageView select;
    private EditText gcmc;
    private EditText wtdw;
    private EditText sgdw;
    private EditText wtr;
    private EditText wtrdh;
    private EditText cydw;
    private EditText cyr;
    private EditText jzdw;
    private EditText jzr;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_project_information);
        initView();
    }

    private void initView() {
        goback = (ImageView) findViewById(R.id.back);
        toptitle = (TextView) findViewById(R.id.tv_top_title);
        select = (ImageView) findViewById(R.id.select);


        gcmc = (EditText) findViewById(R.id.project_information_gcmc);//工程名称
        wtdw = (EditText) findViewById(R.id.project_information_wtdw);//委托单位
        sgdw = (EditText) findViewById(R.id.project_information_sgdw);//施工单位
        wtr = (EditText) findViewById(R.id.project_information_wtr);//委托人
        wtrdh = (EditText) findViewById(R.id.project_information_wtrdh);//委托人电话
        cydw = (EditText) findViewById(R.id.project_information_cydw);//抽样单位
        cyr = (EditText) findViewById(R.id.project_information_cyr);//抽样人
        jzdw = (EditText) findViewById(R.id.project_information_jzdw);//见证单位
        jzr = (EditText) findViewById(R.id.project_information_jzr);//见证人

        goback.setOnClickListener(this);
        toptitle.setText("工程信息录入");
        select.setVisibility(View.INVISIBLE);

    }

    public void judge(){
        if (gcmc==null||gcmc.equals("")){
            ToastUtil.show(this,"工程名称未填写");
            return;
        }else if (wtdw==null||wtdw.equals("")){
            ToastUtil.show(this,"委托单位未填写");
            return;
        }else if (sgdw==null||sgdw.equals("")){
            ToastUtil.show(this,"施工单位未填写");
            return;
        }else if (wtr==null||wtr.equals("")){
            ToastUtil.show(this,"委托人未填写");
            return;
        }else if (wtrdh==null||wtrdh.equals("")){
            ToastUtil.show(this,"委托人电话未填写");
            return;
        }else if (cydw==null||cydw.equals("")){
            ToastUtil.show(this,"抽样单位未填写");
            return;
        }else if (cyr==null||cyr.equals("")){
            ToastUtil.show(this,"抽样人未填写");
            return;
        }else if (jzdw==null||jzdw.equals("")){
            ToastUtil.show(this,"见证单位未填写");
            return;
        }else if (jzr==null||jzr.equals("")){
            ToastUtil.show(this,"见证人未填写");
        }
    }

    public void getedittext(){
        gcmc.getText().toString().trim();
        wtdw.getText().toString().trim();
        sgdw.getText().toString().trim();
        wtr.getText().toString().trim();
        wtrdh.getText().toString().trim();
        cydw.getText().toString().trim();
        cyr.getText().toString().trim();
        jzdw.getText().toString().trim();
        jzr.getText().toString().trim();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.back:
                finish();
                break;

        }
    }
}
